Exportation PDF

apt-get install htmldoc
<?PHP
require(dirname(__FILE__) . '/sdk/sdk.php');
// Chargement des informations de la page
$strPage = ChuWiki::GetCurrentPage();
// Chargement du contenu wiki pour cette page
$strWikiContent = ChuWiki::GetWikiContent($strPage);
// Ajout des contenus spéciaux de certaines pages
$strModifiedWikiContent = ChuWiki::AddSpecialWikiContent($strPage, $strWikiContent);
// Rendu wiki
$strHtmlContent = ChuWiki::Render($strModifiedWikiContent);
header("Content-Type: application/pdf");
header('Content-Disposition: attachment; filename="downloaded.pdf"');
putenv("HTMLDOC_NOCGI=1");
$htmldoc_descriptorspec = array(
 								// stdin is a pipe that the child will read from 
								0 => array("pipe", "r"),  
								// stdout is a pipe that the child will write to */
								1 => array("pipe", "w"));
$htmldoc_process = proc_open("htmldoc -t pdf14 --charset utf8 --color --quiet --jpeg -", $htmldoc_descriptorspec, $pipes);
fwrite($pipes[0], "<html><body><h1>$strPage</h1>$strHtmlContent</body></html>");
fclose($pipes[0]);
fpassthru($pipes[1]);
fclose($pipes[1]);
$returnStatus = proc_close($htmldoc_process);
flush();